<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<title>{echo admin_title()}</title>
<!--header-->
{template _:header}
</head>
<body>
<div class="layui-layout layui-layout-admin">
<!--top-->
{template _main_top}
<!--nav-->
{template _main_nav}
	<div class="position">
		<h1>会员充值记录</h1>
	</div>
	<div class="layui-body admin-body">
		<div class="admin-content">
			<div class="searcher">
				<div class="right"><button type="button" class="layui-btn layui-add">添加</button></div>
				<div class="clear"></div>
			</div>
			<form name="theform" id="theform" method="post" action="{echo \befen\get_url()}">
			<table class="layui-table">
				<thead>
					<tr>
						<th>ID</th>
						<th>名称</th>
						<th>状态</th>
						<th>支付金额</th>
						<th>赠送金额</th>
						<th>创建时间</th>
						<th>管理操作</th>
					</tr>
				</thead>
				<tbody>
					<!--{loop $list $key $val}-->
					<tr id="">
						<td>#{echo (1 + $key)}</td>
						<td>{$val[name]}</td>
						<td><span class="layui-badge layui-bg-status-{$val[status]}">{echo model('MchCharge')->getStatus()[$val[status]]}</span></td>
						<td>{$val[pay_amount]}</td>
						<td>{$val[send_amount]}</td>
						<td>{echo gsdate('Y-m-d H:i:s', $val[time_create])}</td>
						<td class="op">
							<a op="mod" lay-url="{echo url('user/charge_mod', ['id' => $val['id']])}" class="layui-btn layui-btn-xs layui-btn-normal">修改</a>
							<a op="del" lay-url="{echo url('user/charge_del', ['id' => $val['id']])}" class="layui-btn layui-btn-xs layui-btn-danger">删除</a>
						</td>
					</tr>
					<!--{/loop}-->
				</tbody>
			</table>
			</form>
			<div class="listpages">{$pagenav}</div>
		</div>
	</div>
</div>
<!--footer-->
{template _:footer}
<script type="text/javascript">
$(".layui-add").click(function(){	
	showWindow('添加方案', "{echo url('user/charge_add')}", '500px');
});
$("a[op=mod]").click(function(){
	showWindow('修改方案', $(this).attr('lay-url'), '500px');
});
$("a[op=del]").click(function(){
	showDelete($(this).attr('lay-url'));
});
</script>
</body>
</html>